<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <title>TCPDeliver Avisynth Filter</title>
   <link rel="stylesheet" type="text/css" href="../../avisynth.css">
<!--
Automatically generated, don't change:
$Id: tcpdeliver.htm,v 1.3 2006/01/02 14:51:17 wilbertd Exp $
-->

</head>
<body >
<h2>
<a NAME="TCPDeliver"></a>TCPServer / TCPSource
</h2>
<p><code>TCPServer</code> (<var>clip, int &quot;port&quot;</var>)<br>
<code>TCPSource</code> (<var>string hostname, int &quot;port&quot;, string
&quot;compression&quot;</var>)
<p>This filter will enable you to send clips over your network. You can connect several clients to the same machine.
<h3>Syntax</h3>
<h4>Server:</h4>
<p><code>TCPServer</code> (<var>clip, int &quot;port&quot;</var>)<br>
<br>
This will spawn a server thread on the current machine running on the specified port. Port default is 22050.<br>
You will get output in the application you open your script in, but the server will only be running as long as the application (vdub for instance) is open.<br>
<br>
Example:<pre>Colorbars(512, 256)
TCPServer()</pre>
<p>will start a server.<h4>Client:</h4>
<p><code>TCPSource</code> (<var>string hostname, int &quot;port&quot;, string
&quot;compression&quot;</var>)<br>
<br>
This will connect to the machine with the given address (IP-number for instance) to a server running on the given port. Port default is also 22050 here.
<p>Compression enable you to choose the compression used for the video:
<table border="1" width="100%">
  <tr>
    <td width="10%" align="center"><b>Compression Type</b></td>
    <td width="50%" align="center"><b>	Description</b></td>
  </tr>
  <tr>
    <td width="10%">None</td>
    <td width="50%">	Use no compression. Fastest option - video will not be compressed before being sent over the net.</td>
  </tr>
  <tr>
    <td width="10%">LZO</td>
    <td width="50%">Use <a href="http://www.oberhumer.com/opensource/lzo/"><cite>LZO</cite></a> dictionary compression. Fairly fast, but only compresses well on artificial sources, like cartoons and anime with very uniform surfaces.</td>
  </tr>
  <tr>
    <td width="10%">Huffman</td>
    <td width="50%">Uses a fairly slow Huffman routine by <a href="http://bcl.sourceforge.net/"><cite>Marcus
      Geelnard</cite></a>. Compresses natural video better than LZO.</td>
  </tr>
  <tr>
    <td width="10%">GZip</td>
    <td width="50%">Uses a <a href="http://www.gzip.org/"><cite>Gzip</cite></a> Huffman only compression. Works much like Huffman setting, but seems faster.</td>
  </tr>
</table>
<p>If no compression is given, GZip is currently used by default. Interlaced material compresses worse than non-interlaced due to downwards deltaencoding. If network speed is a problem you might want to use
<a href="separatefields.htm">SeparateFields</a>.<p>Example:<pre>TCPSource(&quot;127.0.0.1&quot;)
Info()</pre>
<p>This will connect to the local machine, if a server is running.<h3>Examples</h3>
<p>You can use this to run each/some filters on different PC's. For example:<pre># Clustermember 1:
AVISource
Deinterlacer
TCPServer

# Clustermember 2:
TCPSource
Sharpener
TCPServer

# Clustermember 3:
TCPSource
# client app -&gt; video codec -&gt; final file</pre>
<h3>Usability Notes</h3>
<p>Once you have added a TCPServer, you cannot add more filters to the chain, or use the output from the filter. The server runs in a separate thread, but since AviSynth isn't completely thread-safe you cannot reliably run multiple servers. This should
<b>not</b> be used:</p>
<pre>AviSource("avi.avi")
TCPServer(1001)
TCPServer(1002) # This is NOT a good idea</pre>
<p>So the basic rule is <b>never more than one TCPServer per script</b>.</p>
<p>Using commands after TCPServer is also a bad idea:</p>
<pre>AviSource("avi.avi")
TCPServer(1001)
AviSource("avi2.avi") # Do not do this, this will disable the server.</pre>
<p>AviSynth detects that the output of TCPServer isn't used, so it kills the Server filter.
<b>TCPServer should always be the last filter.</b></p>

<h3>Changelog</h3>
<table border="1">
  <tbody>
    <tr>
      <td>v2.55</td>
      <td>Initial Release</td>
    </tr>
  </tbody>
</table>

<p><kbd>$Date: 2006/01/02 14:51:17 $</kbd></p>
<form><input TYPE="Button" VALUE="Back" onClick="history.go(-1)"></form>
</body>
</html>
